package com.moli.iov.protocol.codec;

import com.moli.iov.protocol.enums.CommandTag;

import java.io.Serializable;
import java.util.Date;

/**
 * @author fudh
 * @ClassNmme VehiclePacket
 * @date 2019/4/19 16:28
 * @Description: 车辆上行报文类
 */
public class VehiclePacket implements Serializable {

    /**
     * 报文的命令，是登陆，注册，还是等
     */
    private CommandTag command;

    /**
     * 车辆的vin
     */
    private  String vin;

    /**
     * 报文上报时间
     */
    private Date collectDate;


    /**
     * 报文主题
     */
    private  String topic;


    /**
     * 有效数据
     */
    private byte[] payload;


    public VehiclePacket(CommandTag command, String vin, Date collectDate, String topic, byte[] payload) {
        this.command = command;
        this.vin = vin;
        this.collectDate = collectDate;
        this.topic = topic;
        this.payload = payload;
    }

    public CommandTag getCommand() {
        return command;
    }

    public void setCommand(CommandTag command) {
        this.command = command;
    }

    public String getVin() {
        return vin;
    }

    public void setVin(String vin) {
        this.vin = vin;
    }

    public Date getCollectDate() {
        return collectDate;
    }

    public void setCollectDate(Date collectDate) {
        this.collectDate = collectDate;
    }

    public String getTopic() {
        return topic;
    }

    public void setTopic(String topic) {
        this.topic = topic;
    }

    public byte[] getPayload() {
        return payload;
    }

    public void setPayload(byte[] payload) {
        this.payload = payload;
    }
}
